package vip.zhenzicheng.design_patterns.singleton.lazy;

/**
 * @author zhenzicheng
 * @date: 2022-05-24 23:10
 */
public class SingletonWithFullSyncLock {
  private static SingletonWithFullSyncLock INSTANCE;

  private SingletonWithFullSyncLock() {
  }

  /**
   * 是懒汉式解决办法第一种，锁力度最大，并发最低，性能最差解决方法
   */
  public synchronized static SingletonWithFullSyncLock getInstance() {
    if (INSTANCE == null) {
      INSTANCE = new SingletonWithFullSyncLock();
    }
    return INSTANCE;
  }
}
